﻿<Window 
  x:Class="IntelliTraceCPConfig.Main"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:local="clr-namespace:IntelliTraceCPConfig"
  xmlns:dw="clr-namespace:DrWPF.Windows.Controls"
  FontSize="13"
  Title="IntelliTrace Collection Plan Configurator"
  Width="435" Height="457" 
  WindowStartupLocation="CenterScreen" Padding="0" Margin="0" WindowStyle="SingleBorderWindow" BorderThickness="10,0" Foreground="White" BorderBrush="White" OpacityMask="White">
    <Window.Resources>
        <ResourceDictionary>
            <!-- Load this specific theme because the Aero theme for CheckBox has issues. -->
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/PresentationFramework.Royale;V3.0.0.0;31bf3856ad364e35;component\themes\royale.normalcolor.xaml" />
            </ResourceDictionary.MergedDictionaries>

            <Style x:Key="TreeViewItemStyle" TargetType="TreeViewItem">
                <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=OneTime}" />
                <Setter Property="IsSelected" Value="{Binding IsInitiallySelected, Mode=OneTime}" />
                <Setter Property="KeyboardNavigation.AcceptsReturn" Value="True" />
                <Setter Property="dw:VirtualToggleButton.IsVirtualToggleButton" Value="True" />
                <Setter Property="dw:VirtualToggleButton.IsChecked" Value="{Binding IsChecked}" />
            </Style>

            <HierarchicalDataTemplate 
        x:Key="CheckBoxItemTemplate"
        ItemsSource="{Binding Children, Mode=OneTime}"
        >
                <StackPanel Orientation="Horizontal">
                    <CheckBox
            Focusable="False" 
            Tag ="{Binding TagKey}"
            IsChecked="{Binding IsChecked}"
            VerticalAlignment="Center"
            />
                    <ContentPresenter 
            Content="{Binding Name, Mode=OneTime}" 
            Margin="2,0"
            />
                </StackPanel>
            </HierarchicalDataTemplate>
        </ResourceDictionary>
    </Window.Resources>

    <Window.DataContext>
        <ObjectDataProvider 
      MethodName="CreateTreeData"
      ObjectType="{x:Type local:IntelliTraceCPConfigViewModel}" />
    </Window.DataContext>

    <DockPanel Margin="0">
        <Menu IsMainMenu="True" DockPanel.Dock="Top" Padding="0,0,0,4">
            <MenuItem Header="_File" >
                <MenuItem Header="_Open"  Click="OpenMenuClick" />
                <MenuItem Header="_Save" Name="SaveMenuItem"  Click="SaveMenuClick"/>
                <MenuItem Header="E_xit"  Click="CloseMenuClick"/>
            </MenuItem>
            <MenuItem Header="_About" Click="AboutMenuClick" />
        </Menu>

        <Button 
      DockPanel.Dock="Bottom" 
      Name="btnSave"
      Content="Save" 
      HorizontalAlignment="Center"
      Margin="0,2"
      Padding="8,0" Click="ButtonClick" Height="32" Width="93" VerticalAlignment="Stretch" IsEnabled="False" />
        <TabControl Name="tabIT" Padding="4" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"  DockPanel.Dock="Left">
            <TabItem Header="General" Name="tabGeneral" >
                <Grid Name="grdGeneral">
                    <RadioButton Content="IntelliTrace events only" Name="rbEventsOnly" Height="16" HorizontalAlignment="Left" Margin="27,71,0,0"  VerticalAlignment="Top" GroupName="rbGEneral" FontWeight="Bold" Checked="rbEventsOnly_Checked" />
                    <RadioButton Content="IntelliTrace events and call informationRadioButton" Name="rbEventsAndCall" Height="16" HorizontalAlignment="Left" Margin="27,128,0,0"  VerticalAlignment="Top" GroupName="rbGEneral" FontWeight="Bold" Checked="rbEventsAndCall_Checked" />
                    <Label Content="Collect the following IntelliTrace information while debugging:" Height="28" HorizontalAlignment="Left" Margin="6,22,0,0" Name="label2" VerticalAlignment="Top" />
                    <Label Content="Collects IntelliTrace events only, which has minimal effects on performance" Height="29" HorizontalAlignment="Left" Margin="21,93,0,0" Name="label3" VerticalAlignment="Top" Width="375" FontSize="11" />
                    <Label Content="Collects call information, which can degrade application performance" FontSize="11" Height="29" HorizontalAlignment="Left" Margin="27,150,0,0" Name="label4" VerticalAlignment="Top" Width="375" />
                </Grid>
            </TabItem>
            <TabItem Header="IntelliTrace Events" Name="tabEvents">
                <Grid>
                    <TreeView 
      x:Name="tree"
      ItemContainerStyle="{StaticResource TreeViewItemStyle}"
      ItemsSource="{Binding Mode=OneTime}"
      ItemTemplate="{StaticResource CheckBoxItemTemplate}" IsEnabled="False" Padding="1,10,1,1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />

                </Grid>
            </TabItem>
            <TabItem Header="Advanced" Name="tabAdvanced" >
                <Grid VerticalAlignment="Top" HorizontalAlignment="Left" Height="117" Width="359">
                    <ComboBox Height="23" Name="MaxamountRecording" Width="183" VerticalContentAlignment="Top" Margin="10,41,0,53" HorizontalAlignment="Left" SelectionChanged="MaxamountRecordingSelectionChanged">
                    </ComboBox>
                    <Label Content="Maximum amount of disk space for each recording" Height="28" HorizontalAlignment="Left" Margin="6,15,0,0" Name="label1" VerticalAlignment="Top" />
                </Grid>
            </TabItem>
            <TabItem Header="Modules" Name="tabModules">
                <Grid VerticalAlignment="Top" HorizontalAlignment="Left" Height="320" Width="401">
                    <RadioButton Content="Collect data from all modules EXCEPT for the following:" Height="16" Name="rbExcluded"  GroupName="Collection" Margin="7,15,13,289" Tag="exclude" Checked="RbExcludedChecked" />
                    <RadioButton Content="Collect data from ONLY the following modules:" Height="16" Margin="7,38,13,266" Name="rbIncluded" GroupName="Collection" Tag="include" Checked="RbIncludedChecked" />

                    <ListBox Name="lstModules" Margin="3,61,0,49" HorizontalAlignment="Left" Width="379" SelectionMode="Multiple" />
                    <Button Content="Add Pattern" Height="27" HorizontalAlignment="Left" Margin="6,277,0,0" Name="btnAddPattern" VerticalAlignment="Top" Width="94" Click="BtnAddPatternClick" />
                    <Button Content="Add Assemblies" Height="27" HorizontalAlignment="Left" Margin="108,277,0,0" Name="btnAddAssemblies" VerticalAlignment="Top" Width="106" Click="BtnAddAssembliesClick" />
                    <Button Content="Remove" Height="27" HorizontalAlignment="Left" Margin="304,277,0,0" Name="btnRemove" VerticalAlignment="Top" Width="75" Click="BtnRemoveClick" />
                </Grid>
            </TabItem>
        </TabControl>

    </DockPanel>


</Window>